<template>
  <div>
    <div
      v-for="(item, index) in wallet.extension?.instructions?.steps"
      :key="index"
      style="display: flex; gap: 16px; max-width: 320px; margin: 0 auto; padding: 32px 0 0 0"
    >
      <img
        v-if="item.step === 'install'"
        style="width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0"
        :src="wallet.icon ?? wallet.iconUrl"
      />
      <Create v-if="item.step === 'create'" style="width: 44px; height: 44px; flex-shrink: 0" />
      <Refresh v-if="item.step === 'refresh'" style="width: 44px; height: 44px; flex-shrink: 0" />
      <div style="font-size: 14px; line-height: 18px; display: flex; flex-direction: column; max-width: 256px">
        <div style="font-weight: bold; margin-bottom: 4px; word-break: break-word">{{ item.title }}</div>
        <div style="color: #ffffff99; word-break: break-word">{{ item.description }}</div>
      </div>
    </div>
    <button style="margin: 16px auto; margin-top: 32px; display: block" @click="() => emits('refresh')">
      Refresh
    </button>
    <button
      @click="() => emits('learnMore')"
      style="background: transparent; color: #d9fc01; display: block; margin: 0 auto"
    >
      Learn More
    </button>
  </div>
</template>
<script setup lang="ts">
  import Create from '../Icons/Create.vue'
  import Refresh from '../Icons/Refresh.vue'
  import type { WalletConnector } from '../../wallets/useWalletConnectors'

  withDefaults(
    defineProps<{
      wallet: WalletConnector
    }>(),
    {}
  )
  const emits = defineEmits(['refresh', 'learnMore'])
</script>

<style lang="scss" scoped>
  button {
    cursor: pointer;
    padding: 4px 12px;
    transition: all 0.3s ease;
    border: none;
    background: #d9fc01;
    color: #1a1b1f;
    border-radius: 24px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: -0.05em;
    line-height: 16px;
    &:hover {
      transform: scale(1.05);
    }
    &:active {
      transform: scale(0.95);
    }
  }
</style>
